﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DTO;
using BLL;

namespace GUI.Home.UC
{
    public partial class UC_GioHang : System.Web.UI.UserControl
    {
        #region Khai báo
        protected List<GioHangDTO> _lstGioHang;
        protected GioHangDTO _ghDTO;
        #endregion

        #region Page_Load
        protected void Page_Load(object sender, EventArgs e)
        {
            _lstGioHang = new List<GioHangDTO>();

            object _gioHang = Session["GioHang"];

            if (_gioHang != null)
            {
                _lstGioHang = (List<GioHangDTO>)Session["GioHang"];
            }
        }
        #endregion

        #region LoadHinhAnh
        protected string LoadHinhAnh(object obj)
        {
            HinhAnhBLL haBLL = new HinhAnhBLL();
            HinhAnhDTO haDTO = new HinhAnhDTO();

            string _result = (string)obj;
            haDTO = haBLL.GetHinhAnhMacDinh(_result);
            if (haDTO.TenHinhAnh == null)
                return "Home/images/no_image.jpg";
            return haDTO.TenHinhAnh;
        }
        #endregion
    }
}